<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>预定义常量</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="filter.filters.flags.html">Filter flags</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="filter.examples.html">范例</a></div>
 <div class="up"><a href="book.filter.html">Filter</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="filter.constants" class="appendix">
 <h1>预定义常量</h1>

 <p class="simpara">下列常量由此扩展定义，且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
 <dl>

  
   <dt id="constant.input-post">
    <strong><code>INPUT_POST</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     <a href="reserved.variables.post.html" class="link">POST</a> variables.
    </span>
   </dd>

  
  
   <dt id="constant.input-get">
    <strong><code>INPUT_GET</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     <a href="reserved.variables.get.html" class="link">GET</a> variables.
    </span>
   </dd>

  
  
   <dt id="constant.input-cookie">
    <strong><code>INPUT_COOKIE</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     <a href="reserved.variables.cookies.html" class="link">COOKIE</a> variables.
    </span>
   </dd>

  
  
   <dt id="constant.input-env">
    <strong><code>INPUT_ENV</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     <a href="reserved.variables.environment.html" class="link">ENV</a> variables.
    </span>
   </dd>

  
  
   <dt id="constant.input-server">
    <strong><code>INPUT_SERVER</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     <a href="reserved.variables.server.html" class="link">SERVER</a> variables.
    </span>
   </dd>

  
  
   <dt id="constant.input-session">
    <strong><code>INPUT_SESSION</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     <a href="reserved.variables.session.html" class="link">SESSION</a> variables.
    (not implemented yet)
    </span>
   </dd>

  
  
   <dt id="constant.input-request">
    <strong><code>INPUT_REQUEST</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     <a href="reserved.variables.request.html" class="link">REQUEST</a> variables.
    (not implemented yet)
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-none">
    <strong><code>FILTER_FLAG_NONE</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     No flags.
    </span>
   </dd>

  
  
   <dt id="constant.filter-require-scalar">
    <strong><code>FILTER_REQUIRE_SCALAR</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
      Flag used to require scalar as input
    </span>
   </dd>

  
  
   <dt id="constant.filter-require-array">
    <strong><code>FILTER_REQUIRE_ARRAY</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
      Require an array as input. 
    </span>
   </dd>

  
  
   <dt id="constant.filter-force-array">
    <strong><code>FILTER_FORCE_ARRAY</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Always returns an array.
    </span>
   </dd>

  
  
   <dt id="constant.filter-null-on-failure">
    <strong><code>FILTER_NULL_ON_FAILURE</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Use NULL instead of FALSE on failure. 
    </span>
   </dd>

  
  
   <dt id="constant.filter-validate-int">
    <strong><code>FILTER_VALIDATE_INT</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;int&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-validate-boolean">
    <strong><code>FILTER_VALIDATE_BOOLEAN</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;boolean&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-validate-float">
    <strong><code>FILTER_VALIDATE_FLOAT</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;float&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-validate-regexp">
    <strong><code>FILTER_VALIDATE_REGEXP</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;validate_regexp&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-validate-url">
    <strong><code>FILTER_VALIDATE_URL</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;validate_url&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-validate-email">
    <strong><code>FILTER_VALIDATE_EMAIL</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;validate_email&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-validate-ip">
    <strong><code>FILTER_VALIDATE_IP</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;validate_ip&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-default">
    <strong><code>FILTER_DEFAULT</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
    ID of default (&quot;string&quot;) filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-unsafe-raw">
    <strong><code>FILTER_UNSAFE_RAW</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;unsafe_raw&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-sanitize-string">
    <strong><code>FILTER_SANITIZE_STRING</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;string&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-sanitize-stripped">
    <strong><code>FILTER_SANITIZE_STRIPPED</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;stripped&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-sanitize-encoded">
    <strong><code>FILTER_SANITIZE_ENCODED</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;encoded&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-sanitize-special-chars">
    <strong><code>FILTER_SANITIZE_SPECIAL_CHARS</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;special_chars&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-sanitize-email">
    <strong><code>FILTER_SANITIZE_EMAIL</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;email&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-sanitize-url">
    <strong><code>FILTER_SANITIZE_URL</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;url&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-sanitize-number-int">
    <strong><code>FILTER_SANITIZE_NUMBER_INT</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;number_int&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-sanitize-number-float">
    <strong><code>FILTER_SANITIZE_NUMBER_FLOAT</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;number_float&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-sanitize-magic-quotes">
    <strong><code>FILTER_SANITIZE_MAGIC_QUOTES</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;magic_quotes&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-callback">
    <strong><code>FILTER_CALLBACK</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     ID of &quot;callback&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-allow-octal">
    <strong><code>FILTER_FLAG_ALLOW_OCTAL</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Allow octal notation (<em>0[0-7]+</em>) in &quot;int&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-allow-hex">
    <strong><code>FILTER_FLAG_ALLOW_HEX</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Allow hex notation (<em>0x[0-9a-fA-F]+</em>) in &quot;int&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-strip-low">
    <strong><code>FILTER_FLAG_STRIP_LOW</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Strip characters with ASCII value less than 32.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-strip-high">
    <strong><code>FILTER_FLAG_STRIP_HIGH</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Strip characters with ASCII value greater than 127.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-encode-low">
    <strong><code>FILTER_FLAG_ENCODE_LOW</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Encode characters with ASCII value less than 32.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-encode-high">
    <strong><code>FILTER_FLAG_ENCODE_HIGH</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Encode characters with ASCII value greater than 127.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-encode-amp">
    <strong><code>FILTER_FLAG_ENCODE_AMP</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Encode <em>&amp;</em>.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-no-encode-quotes">
    <strong><code>FILTER_FLAG_NO_ENCODE_QUOTES</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Don&#039;t encode <em>&#039;</em> and <em>&quot;</em>.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-empty-string-null">
    <strong><code>FILTER_FLAG_EMPTY_STRING_NULL</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     (No use for now.)
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-allow-fraction">
    <strong><code>FILTER_FLAG_ALLOW_FRACTION</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Allow fractional part in &quot;number_float&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-allow-thousand">
    <strong><code>FILTER_FLAG_ALLOW_THOUSAND</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Allow thousand separator (<em>,</em>) in &quot;number_float&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-allow-scientific">
    <strong><code>FILTER_FLAG_ALLOW_SCIENTIFIC</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Allow scientific notation (<em>e</em>, <em>E</em>) in
     &quot;number_float&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-path-required">
    <strong><code>FILTER_FLAG_PATH_REQUIRED</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Require path in &quot;validate_url&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-query-required">
    <strong><code>FILTER_FLAG_QUERY_REQUIRED</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Require query in &quot;validate_url&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-ipv4">
    <strong><code>FILTER_FLAG_IPV4</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Allow only IPv4 address in &quot;validate_ip&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-ipv6">
    <strong><code>FILTER_FLAG_IPV6</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Allow only IPv6 address in &quot;validate_ip&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-no-res-range">
    <strong><code>FILTER_FLAG_NO_RES_RANGE</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Deny reserved addresses in &quot;validate_ip&quot; filter.
    </span>
   </dd>

  
  
   <dt id="constant.filter-flag-no-priv-range">
    <strong><code>FILTER_FLAG_NO_PRIV_RANGE</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Deny private addresses in &quot;validate_ip&quot; filter.
    </span>
   </dd>

  
 </dl>

</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="filter.filters.flags.html">Filter flags</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="filter.examples.html">范例</a></div>
 <div class="up"><a href="book.filter.html">Filter</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
